package com.crm.business.crm.service;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.crm.common.crm.common.ElasticUtil;
import com.crm.common.crm.constant.CrmActivityEnum;
import com.crm.common.crm.constant.CrmCodeEnum;
import com.crm.common.crm.entity.BO.CrmSearchBO;
import com.crm.common.crm.entity.PO.CrmCustomerPool;
import com.crm.common.crm.entity.PO.CrmTimeTable;
import com.crm.common.ka.core.entity.BasePage;
import com.crm.common.ka.core.exception.CrmException;
import com.crm.common.ka.core.feign.crm.entity.ExamineField;
import com.crm.common.ka.core.feign.crm.entity.SimpleCrmEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.transaction.annotation.Transactional;

import java.util.*;
import java.util.stream.Collectors;

public interface CrmService {

    /**
     * 查询客户信息
     *
     * @param ids ids
     * @return entity
     */
    public List<SimpleCrmEntity> queryCustomerInfo(Collection ids);


    /**
     * 查询客户信息(like)
     *
     * @param name 名字
     * @return entity
     */
    public List<SimpleCrmEntity> queryByNameCustomerInfo(String name);


    /**
     * 查询客户信息(eq)
     *
     * @param name 名字
     * @return entity
     */
    public List<SimpleCrmEntity> queryNameCustomerInfo(String name);

    /**
     * 查询联系人信息
     *
     * @param ids ids
     * @return entity
     */
    public List<SimpleCrmEntity> queryContactsInfo(Collection ids);

    /**
     * 查询商机信息
     *
     * @param ids ids
     * @return entity
     */
    public List<SimpleCrmEntity> queryBusinessInfo(Collection ids);

    /**
     * 查询合同信息
     *
     * @param ids ids
     * @return entity
     */
    public List<SimpleCrmEntity> queryContractInfo(Collection ids);

    public List<SimpleCrmEntity> queryProductInfo();

    /**
     * 添加活动记录
     *
     * @param type
     * @param activityType   活动类型
     * @param activityTypeId 类型ID
     * @return
     */
    public void addActivity(Integer type, Integer activityType, Integer activityTypeId);

    public void batchUpdateEsData(String id, String name);

    public void putInInternational();

    public List<CrmCustomerPool> queryPoolNameListByAuth() ;

    public List<ExamineField> queryExamineField(Integer label);

    public BasePage<Map<String, Object>> queryCustomerPageList(CrmSearchBO search);

    public void roiSatistics();

    public void updateLargeScreenSettingDataStatus(String checkStatus, String batchId);


    public void updateCrmDealStatus();

    public CrmTimeTable queryTimeTableDataById(Integer id);

}
